function [newpath] = cr_dirpath( rpath , varargin ); 
% ======================================================================
% CR_DIRPATH
%
% Create the corresponding output string WITHOUT CREATING THE DIRECTORY ! 
% 
% Use CR_DIR    to create a directory and string 
%     CH_EXDIR  to create string and check the directory exists 
% 
% Input
% ------
% RPATH     Root path from where to start looking 
%           If [] will be where the invoking code is running from 
% 
% VARARGIN  Variable number of strings to be combined to form a final
%           directory name 
% 
% In the case of UNIX the code will check for the exact case 
% 
% NEWPATH   Corresponding string 
% 
% Use CH_EXDIR to check & create composite existing directory names 
% 
% Alejandro Justiniano 10/22/2005 
% =========================================================================
nn = nargin; 
ind = isunix; 
if ind== 1  
    sep = '/'; 
else 
    sep = '\'; 
end 

if nn == 1
    switch ind
        case 0
            error('Need at least 1 input other than the rootpath')
        case 1
            newpath ='/lcl/msu/home/m1axj00';
            ch = 1; 
            return
    end
end 

if isempty( rpath ) & isstr( rpath ) == 0 
    rpath = cd ;
end

newpath =rpath;
ii=1;
for ii=1:nn-1
       newpath = [newpath,sep,varargin{ii}];
end
